From 00f1169fb8a41d1f5cd6d2bc41f692c9ceb63a4b Mon Sep 17 00:00:00 2001
From: Rob Browning <rlb@defaultvalue.org>
Date: Mon, 4 Apr 2011 22:46:22 -0500
Subject: Run debian-startup and set debian-emacs-flavor.

Emacs runs debian-startup and sets debian-emacs-flavor.

* Emacs runs debian-startup during the startup process unless
  site-run-file is false.

* The global variable debian-emacs-flavor is bound to 'emacs24.
  Author: Rob Browning <rlb@defaultvalue.org>
---
 lisp/startup.el |   21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/lisp/startup.el b/lisp/startup.el
index 5c90595..2edfae8 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -412,6 +412,10 @@ The second subexpression is the version string.
 The regexp should not contain a starting \"\\`\" or a trailing
  \"\\'\"; those are added automatically by callers.")
 
+(defconst debian-emacs-flavor 'emacs24
+  "A symbol representing the particular debian flavor of emacs running.
+Something like 'emacs20, 'xemacs20, etc.")
+
 (defun normal-top-level-add-subdirs-to-load-path ()
   "Add all subdirectories of `default-directory' to `load-path'.
 More precisely, this uses only the subdirectories whose names
@@ -987,8 +991,21 @@ Amongst another things, it parses the command-line arguments."
     ;; be loaded from site-run-file and wants to test if -q was given
     ;; should check init-file-user instead, since that is already set.
     ;; See cus-edit.el for an example.
-    (if site-run-file
-	(load site-run-file t t))
+
+    ;; Original upstream startup
+    ;; (if site-run-file
+    ;;     (load site-run-file t t))
+    ;;
+
+    ;; Debian startup
+     (if site-run-file
+        (progn
+          ;; Load all the debian package snippets.
+          ;; It's in here because we want -q to kill it too.
+          (if (load "debian-startup" t t nil)
+              (debian-startup debian-emacs-flavor))
+          ;; Now the normal site file...
+          (load site-run-file t t)))
 
     ;; Sites should not disable this.  Only individuals should disable
     ;; the startup screen.
